const { Article } = require('../../model/article')
const pagination = require('mongoose-sex-page')
module.exports = async(req, res) => {
    let page = req.query.page
    req.app.locals.whatLink = 'arc'
    let articles = await pagination(Article).find().page(page).size(3).display(3).populate('author').exec()
        // let pagecount = Math.ceil(articles.total / articles.size)


    res.render('admin/article', {
        articles: articles
    })
}